/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// ptitle.hpp - PegTitle class definition.
//
// Author: Kenneth G. Maxwell
//
// Copyright (c) 1997-2000 Swell Software 
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef _PEGTITLE_
#define _PEGTITLE_

#ifndef PEG_SYS_BTN_SIZE
#define PEG_SYS_BTN_SIZE PEG_SCROLL_WIDTH    // for adjustable size
#endif

#ifndef TITLE_GRAD_SLICE
 #define TITLE_GRAD_SLICE 32
#endif

/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
enum
{
    PCI_TITLE_GRAD1 = 0,
    PCI_TITLE_GRAD1_SEL,
    PCI_TITLE_TEXT,         // KEEP NORMAL TEXT AND SELECTED TEXT
    PCI_TITLE_TEXT_SEL,     // IN THEIR ORIGINAL POSITIONS FOR COMPATIBILITY
    PCI_TITLE_GRAD2,
    PCI_TITLE_GRAD2_SEL,
    PCI_TITLE_GRAD3,
    PCI_TITLE_GRAD3_SEL,
    PCI_TITLE_GRAD4,
    PCI_TITLE_GRAD4_SEL,
    PCI_TITLE_GRAD5,
    PCI_TITLE_GRAD5_SEL,
    MAX_EXT_TITLE_COLORS
};


class PegTitle : public PegTextThing
{
    public:
        PegTitle(PEGINT StringId, PEGULONG Style = 
                 TF_SYSBUTTON|TF_MINMAXBUTTON|TF_CLOSEBUTTON);

        PegTitle(const PEGCHAR *pText, PEGULONG Style = 
                 TT_COPY|TF_SYSBUTTON|TF_MINMAXBUTTON|TF_CLOSEBUTTON);

        virtual ~PegTitle();

        void AssignMenu(PegMenuDescription *pMenu);
        virtual void Draw(const PegRect &Invalid);
        virtual PEGUINT GetColor(const PEGUBYTE Index);
        virtual PEGINT Message(const PegMessage &Mesg);
        virtual void SetColor(const PEGUBYTE Index, const PEGUINT ColorId);
        virtual void SetFont(PEGUINT FontIndex);

        enum TitleButtons 
        {
            IDB_MAX = 1008,
            IDB_MIN,
            IDB_RESTORE
        };

    protected:
            
        void Construct(PEGULONG Style);

        virtual void SizeToParent(void);

       #ifdef PEG_PRO
        PEGUINT mExtColorIDs[MAX_EXT_TITLE_COLORS];
        PegGradientStruct mGrad;
       #endif

        PegIconButton *mpSysButton;
        PegIconButton *mpCloseButton;
        PegIconButton *mpMinButton;
        PegIconButton *mpMaxButton;
        PegMenu *mpMenu;
        PEGINT mHeight;

};


#endif

